using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;

namespace SolanumSolstice.Mapping
{
    public class Tile
    {
        public const int TILEWIDTH = 32;
        public const int TILEHEIGHT = 32;
        private Vector2 position;
        private Texture2D texture;
        private bool isWalkable;
        private bool isVisible;

        #region Accessors
        public Vector2 Position
        {
            get
            {
                return position;
            }
            set
            {
                position = value;
            }
        }

        public bool IsWalkable
        {
            get
            {
                return isWalkable;
            }
            set
            {
                isWalkable = value;
            }
        }

        public bool IsVisible
        {
            get
            {
                return isVisible;
            }
            set
            {
                isVisible = value;
            }
        }
        #endregion

        public Tile(Vector2 position, Texture2D texture, bool walkable)
        {
            this.position = position;
            this.texture = texture;
            this.isWalkable = walkable;
            this.isVisible = false;
        }

        public void Draw(SpriteBatch spritebatch, int mapFocusX, int mapFocusY)
        {
            
            Color color = new Color(0, 0, 0, 0);

            if (!isVisible)
            {
                color = new Color(new Vector4(0, 0, 0, 0.85f));
            }

            spritebatch.Draw(texture, new Rectangle((int)position.X - mapFocusX, (int)position.Y - mapFocusY, 32, 32), color);
             

          
        }
    }
}
